<!--这个就是商品的详情页-->
<template>
  <div>
    <navbar>
      <div slot="left" class="back" @click="backClick">
        <img src="~assets/img/common/back.svg" alt />
      </div>

      <div slot="center" class="title">
        <div
          v-for="(item,index) in childetail"
          class="title-item"
          @click="clicknavabar(index)"
          :class="{active:count==index}"
        >{{item}}</div>
      </div>
    </navbar>
  </div>
</template>

<script>
import navbar from "components/common/navbar/navbar";
export default {
  name: "childdetail",
  data() {
    return {
      childetail: ["商品", "参数", "评论", "推荐"],
      count: 0
    };
  },
  components: {
    navbar
  },
  methods: {
    clicknavabar(index) {
      this.count = index;
      this.$emit("clicknavbar",index);
    },
    backClick() {
      this.$router.back();
    }
  }
};
</script>

<style>
.title {
  display: flex;
}
.title-item {
  flex: 1;
}
.active {
  color: red;
}
.back img {
  margin-top: 12px;
}
</style>
